<!DOCTYPE html>
<html>

<head>
    <meta name="layout" content="main2"/>
    <g:set var="entityName" value="${message(code: 'flexField.label', default: 'flexField')}"/>
    <title>新增弹性域</title>
</head>

<body>

<div class="main-body">
    <div class="page-wrapper">
        <!-- Page-header start -->
        <div class="page-header">
            <div class="page-header-title">
                <h4>新增弹性域</h4>
            </div>

            <div class="page-header-breadcrumb">
                <ul class="breadcrumb-title">
                    <li class="breadcrumb-item">
                        <a href="/salesDashboard/index">
                            <i class="icofont icofont-home"></i>
                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <g:link controller="flexFieldCategory" action="show" id="${this.flexField?.category?.id}">弹性域模块列表</g:link>
                    </li>
                    <li class="breadcrumb-item"><a href="#!">新增弹性域</a>
                    </li>
                </ul>
            </div>
        </div>
        <!-- Page-header end -->
        <!-- Page-body start -->
        <div class="page-body">
            <g:if test="${flash.message}">
                <div class="message" role="status">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${this.flexField}">
                <ul class="errors" flexField="alert">
                    <g:eachError bean="${this.flexField}" var="error">
                        <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>>
                            <g:message error="${error}"/>
                        </li>
                    </g:eachError>
                </ul>
            </g:hasErrors>
        <!-- Hover table card start -->
            <div class="card">
                <div class="card-header">
                    <h5>新增弹性域</h5>

                    <div class="card-header-right">

                        <i class="icofont icofont-rounded-down"></i>
                    </div>
                </div>

                <div class="card-block">
                    <g:form action="save" class="form-horizontal">

                        <input type="hidden" name="category.id" value="${this.flexField?.category?.id}">

                        <div class="form-group row">
                            <label class="col-md-2 control-label">名称</label>

                            <div class="col-md-3">
                                <g:textField type="text" name="name" id="name" class="form-control"
                                             value="${this.flexField?.name}"/>
                            </div>
                            <label class="col-md-2 control-label">数据类型</label>

                            <div class="col-md-3">
                                <g:select class="form-control" id="dataType" name="dataType"
                                          noSelection="${['': '请选择']}"
                                          from="${this.flexField.constrainedProperties.dataType.inList}"
                                          valueMessagePrefix="dataType" value="${this.flexField?.dataType}"/>
                            </div>

                        </div>





                        <div class="form-group row">
                            <label class="col-md-2 control-label">默认值</label>

                            <div class="col-md-3">
                                <g:textField type="text" id="defaultValue" name="defaultValue" class="form-control"
                                             value="${this.flexField?.defaultValue}"/>
                            </div>
                            <label class="col-md-2 control-label">次序</label>

                            <div class="col-md-3">
                                <g:textField type="text" value="${this.flexField?.displayOrder}" name="displayOrder" id="displayOrder" class="form-control"/>
                            </div>

                        </div>
                        <div class="form-group row">


                            <label class="col-md-2 control-label">约束</label>

                            <div class="col-md-3">
                                <g:textField type="text" id="valueConstraints" name="valueConstraints"
                                             class="form-control" value="${this.flexField?.valueConstraints}"/>
                            </div>
                            <label class="col-md-2 control-label">有效性</label>
                            <div class="col-md-3 border-checkbox-section">
                                <div class="border-checkbox-group border-checkbox-group-primary form-control-static">
                                    <g:checkBox class="border-checkbox" name="active" id="checkbox0"
                                                value="${this.flexField?.active}"/>
                                    <label class="border-checkbox-label" for="checkbox0"></label>
                                </div>

                            </div>
                        </div>

                        <div class="form-group row">
                            <label class="col-md-2 control-label">描述</label>

                            <div class="col-md-8">
                                <g:textArea rows="3" type="text" name="description" id="description" class="form-control"
                                             value="${this.flexField?.description}"/>
                            </div>

                        </div>


                        <div class="form-group row">
                            <div class="col-md-12">
                                <g:submitButton name="create" class="btn btn-info" value="保存"/>
                            </div>
                        </div>
                    </g:form>

                </div>
                <!-- Hover table card end -->
            </div>

            <!-- Page-body end -->
        </div>
    </div>
</div>

</body>

</html>

